The present invention relates generally to dynamic instrumentation, and, more particularly, to secure dynamic instrumentation.
Dynamic instrumentation refers to obtaining instrumentation data for an executable program (also referred to as an “executable application” or “application”) while the program is executing without any pre-processing. An example of dynamic instrumentation is modification of the running image of an application. Such modification typically changes the instructions executed in such a way as to provide insight into the operation of the application without interfering with the correct operation of the application. Thus, the same executable program that is used in a production environment may be executed and instrumented post-production. The dynamic instrumentation is performed by creating instrumented versions of functions when the functions are invoked, and thereafter modifying existing instructions, adding instrumentation, and then executing the original instructions.
Linux supports dynamic instrumentation, as with kernel dynamic probes (kprobes). Kprobes provide a lightweight interface for kernel modules to implant probes and register corresponding probe handlers. A probe is an automated breakpoint that may be implanted dynamically in executing kernel-space code, including modules loaded into the kernel space, without having to modify the underlying source.
Probes are intended to be used as ad hoc service aids where minimal disruption to the system is required. They are particularly advantageous in production environments where the use of interactive debuggers is undesirable. Kprobes also have substantial applicability in test and development environments.
With each probe, a corresponding probe event handler address is specified. Probe event handlers run as extensions to the system breakpoint interrupt handler and are expected to have little or no dependence on system facilities. Because of this design, probes are able to be implanted in the most hostile environments without adversely impacting system performance.
Currently, dynamic instrumentation in Linux requires root privileges. Most system administrators prefer to limit access to escalated privileges so that system security is not compromised. However, enabling more users to use safe system dynamic instrumentation operations without the highest privilege levels would allow more users on the system to utilize the debugging tools of dynamic instrumentation.
Thus, there exists a need for enabling secure dynamic instrumentation without granting root privileges.